function createPopUp(e,itemId)
{
    if (itemId >= 0)
    {
        var IE = document.all?true:false;
        var tempX = 0;
        var tempY = 0;
        var div = document.createElement('div');

        if (IE)
        {
            tempX = event.clientX + document.body.scrollLeft;
            tempY = event.clientY + document.body.scrollTop;
        }
        else
        {
            tempX = e.pageX;
            tempY = e.pageY;
        }

        if (tempX < 0) { tempX = 0; }
        if (tempY < 0) { tempY = 0; }

        // Adjust the iframe positioning
        tempX += 25;
        tempY += 10;
        div.innerHTML = '<div id="data_popup" style="position:absolute;top:'+tempY+'px;left:'+tempX+'px;"><iframe name="item_stats" src="./viewitemdata.php?s=&amp;i='+itemId+'&amp;iframe=true" width="451" height="173" scrolling="no" frameborder="1"></iframe></div>';
        document.body.appendChild(div.firstChild);
    }
}

function removePopUp()
{
    div = document.getElementById('data_popup');
    if (div)
    {
        div.parentNode.removeChild(div);
    }
}